package com.cet.lxf.generic.test03;

/**
 * @program: algorithm
 * @description:
 * @author: 陈恩涛
 * @create: 2021-08-02 16:18
 **/
public class Main {
    public static void main(String[] args) {
        Pair1[] arr = new Pair1[2];
        Pair1<String>[] ps = (Pair1<String>[]) arr;

        ps[0] = new Pair1<String>("a", "b");
        arr[1] = new Pair1<Integer>(1, 2);
    }
}

class Pair1<T> {
    private T first;
    private T last;
    public Pair1(T first, T last) {
        this.first = first;
        this.last = last;
    }
    public T getFirst() {
        return first;
    }
    public T getLast() {
        return last;
    }
}
